<template>
  <div class="message-input-box">
    <el-tabs v-model="activeName" class="message-content" @tab-click="handleClick">
      <el-tab-pane label="聊天" name="first">
        <el-input
            v-model="textarea"
            maxlength="500"
            style="width: 100%;"
            type="textarea"
            rows="8"
            resize="none"
            placeholder="Please input"
        />
        <el-button type="primary" @click="sendmessage">发送</el-button>
      </el-tab-pane>
      <el-tab-pane label="表情包" name="second">Config</el-tab-pane>
      <el-tab-pane label="文件上传" name="third">Role</el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import  {defineComponent} from "vue";
export  default defineComponent({
  name:"chat",
  emits:['sendmessage'],

  data()
  {
    return {
      activeName: 'first',
      textarea:''
    }
  },
  methods:{
    handleClick(tab, event) {
      console.log(tab, event);
    },
    sendmessage()
    {
      console.log(this.textarea)
      this.$emit('sendmessage',this.textarea)

    }
  }

})
</script>
<style>
.message-input-box {
  margin: 2px;
  background: #f5f5f5;
  min-height: 80px;

}
.message-content {
  min-height: 225.6px;
}
.message-content > .el-tabs__content {
  //padding: 6px;
  color: #6b778c;
  font-size: 32px;
  font-weight: 600;
}

</style>
